WDV2221 Intro Javascript

Unit-4 Assignment - Functions with Parameters

Directions:

Problem 1

a. Create a global variable called schoolName. Assign it an initial value of "Des Moines Area Community College".

b. Create a function called processString( ).

c. Call this function using a button and the onclick event handler. Pass in the schoolName variable as the parameter.

Problem 2

a. Create two global variables. One called name1 and assign it a value of "Mary". The other called name2 and assign it a value of "Smith".

b.  Create a function called printName( ).

c. Call this function during runtime. Pass in the name1 and name2 variables as the parameters.

Problem 3

a. Create a global variable called totalSales. Assign it a value of 3435.6. It should be numeric data type.

b. Use the provided currency formatting function to display totalSales formatted as currency in the following line.

Your Total Sales:

Problem 4

a. Use the provided date functions and concatenation to display today's date in the following format Monday, January 2, 2018.

Today's date:

Problem 5

a. Use the provided date functions and concatenation to display today's date in the following format "mm/dd/yyyy".

Today's date:

 

Click here to access my Javascript Home Work Page

Click here to access my Javascript Home Page